package csse3004.GD.PM;

import csse3004.GD.USTemp;
import java.util.ArrayList;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
import javax.servlet.ServletException;

public class ReportQuestionController extends SimpleFormController {
    
    @Override
    public ModelAndView onSubmit(Object command) throws ServletException {   
        
        ReportQuestion rq = (ReportQuestion) command;
        String entityHierarchy = rq.getEntity();
        logger.info("Entity Hierarchy: " + entityHierarchy);

        ArrayList<EntityHierarchy> resultList = new ArrayList<EntityHierarchy>();
        resultList = EntityHierarchy.genTempEntityHierarchy();
       // String resultList = "Result is displayed";
        return new ModelAndView("reportQuestionResult", "searchResult", resultList);
        //return new ModelAndView(new RedirectView(getSuccessView()),"Result", resultList);
    }
    
    /*
     * TODO CAPTAIN THOMAS.L.MCNAIR BSC, SSC
     * 
     * Function which will retrieve all polls
     */
}
